bitkeeper revision 1.1159.1.312 (41837e24AgGTJo-4Cu3-XiU5i0cX2w)
authorkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>
Sat, 30 Oct 2004 11:42:28 +0000 (11:42 +0000)
committerkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>
Sat, 30 Oct 2004 11:42:28 +0000 (11:42 +0000)
Some very small time cleanups. Also call cur_timer->init during resume.

linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c
linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c

index 9a11137f075cedddc0bd02e16fc3d4ca9060346a..1edc1cbf836f120e480813420b8be8a801ded753 100644 (file)
@@ -675,21 +675,26 @@ int set_timeout_timer(void)
 
 void time_suspend(void)
 {
+       /* nothing */
 }
 
+/* No locking required. We are only CPU running, and interrupts are off. */
 void time_resume(void)
 {
-    unsigned long flags;
-    write_seqlock_irqsave(&xtime_lock, flags);
-    /* Get timebases for new environment. */ 
-    __get_time_values_from_xen();
-    /* Reset our own concept of passage of system time. */
-    processed_system_time = shadow_system_time;
-    /* Accept a warp in UTC (wall-clock) time. */
-    last_seen_tv.tv_sec = 0;
-    /* Make sure we resync UTC time with Xen on next timer interrupt. */
-    last_update_from_xen = 0;
-    write_sequnlock_irqrestore(&xtime_lock, flags);
+       if (cur_timer->init(NULL) != 0)
+               BUG();
+
+       /* Get timebases for new environment. */ 
+       __get_time_values_from_xen();
+
+       /* Reset our own concept of passage of system time. */
+       processed_system_time = shadow_system_time;
+
+       /* Accept a warp in UTC (wall-clock) time. */
+       last_seen_tv.tv_sec = 0;
+
+       /* Make sure we resync UTC time with Xen on next timer interrupt. */
+       last_update_from_xen = 0;
 }
 
 /*
index 683ad982cafaac3e430f586f98c7069722db13bf..d4d64de094fbd66d24253e0e58b45ab80625719f 100644 (file)
@@ -332,7 +332,6 @@ static inline void cpufreq_delayed_get(void) { return; }
 
 static int __init init_tsc(char* override)
 {
-       unsigned long long alarm;
        u64 __cpu_khz;
 
        __cpu_khz = HYPERVISOR_shared_info->cpu_freq;
@@ -353,9 +352,7 @@ static int __init init_tsc(char* override)
 
        set_cyc2ns_scale(cpu_khz/1000);
 
-       rdtscll(alarm);
-
-       use_tsc=1;
+       use_tsc = 1;
 
        return 0;
 }